try:
    from plc_client.layer1.mdsTcp_client import MdsClient
    from plc_client.layer1.s7_client import S7Client
    from plc_client.layer1.sim_client import SimClient
except:
    from mdsTcp_client import MdsClient
    from s7_client import S7Client
    from sim_client import SimClient

class Lay1PLCFactory: #
    @staticmethod
    def create(class_type, ip='127.0.0.1', port=1102):
        if class_type == "modbus_tcp":
            return MdsClient(ip=ip, port=port)
        elif class_type == "s7_tcp":
            return S7Client(ip=ip, port=port)
        elif class_type == "sim":
            return SimClient(ip=ip, port=port)
        else:
            raise ValueError("Invalid transport type")